package com.yangzihao.service.impl;
import com.yangzihao.entity.NewsDetail;
import com.yangzihao.mapper.NewsDetailMapper;
import com.yangzihao.service.NewsDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@Transactional
public class NewsDetailServiceImpl implements NewsDetailService {

    @Autowired
    private NewsDetailMapper newsDetailMapper;

    @Override
    public void insertNewsDet(NewsDetail newsDetail) {
        newsDetailMapper.insertNewsDet(newsDetail);
    }

    @Override
    public List<NewsDetail> findByCondition(NewsDetail newsDetail) {
        return newsDetailMapper.findByCondition(newsDetail);
    }

    @Override
    public NewsDetail findById(Integer id) {
        return newsDetailMapper.findById(id);
    }

    @Override
    public void updateDetial(NewsDetail newsDetail) {
        newsDetailMapper.updateDetail(newsDetail);
    }

    @Override
    public NewsDetail findByTitle(String title) {
        return newsDetailMapper.findByTitle(title);
    }

}
